function multiclass_model = trainadaboost(xtrain,ytrain,nLabel,nIter)

% xtrain - The training data. RxC Rows - number of samples, Columns - the
% dimension of the samples.
% ytrain - The labels associated with the training data - Rx1 vector.
% nLabel - The number of classes.
% nIter - The maximum number of boosting iterations.
trlabel = [];

for act = 1 : nLabel
    trlabel(find(ytrain ~= act)) = -1;
    trlabel(find(ytrain == act)) = 1;        
    [trerr{act} multiclass_model{act}] = call_boosting(xtrain,trlabel',nIter);    
    % waitbar(act/nLabel,h,sprintf('Training Boosted classifier for action %d.',act));
end
    